package es.cazadoresmadridejos.beans.service.mail;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.MailSender;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.stereotype.Service;

@Service
public class MailService {
	
	public enum MailSubject{
		NEW_ADVERTISEMENT, NEW_BIGGAME, NEW_PHOTO, NEW_ADVICED,GENERAL
	}

	@Autowired private MailSender mailSender;
	public static final String FROM = "cazadores.madridejos@gmail.com";
	
	
	public void sendMail(String to, String subject, String msg) {
		 
		SimpleMailMessage message = new SimpleMailMessage();
 
		message.setFrom(FROM);
		message.setTo("alfonso_ash@hotmail.com");
		message.setSubject(subject);
		message.setText(msg);
		mailSender.send(message);	
	}
}
